<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Tetris Game: /home/hokan/NetBeansProjects/TetrisGame/headers/CFigure.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tetris Game
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Test game project created via Irrlicht and Qt</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_c_figure_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">/home/hokan/NetBeansProjects/TetrisGame/headers/CFigure.h</div>  </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* </span>
<a name="l00002"></a>00002 <span class="comment"> * File:   CFigure.h</span>
<a name="l00003"></a>00003 <span class="comment"> * Author: hokan</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created on 27 Июнь 2014 г., 18:05</span>
<a name="l00006"></a>00006 <span class="comment"> */</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;headers/CGameFieldManager.h&quot;</span>
<a name="l00009"></a>00009 
<a name="l00010"></a>00010 <span class="preprocessor">#pragma GCC diagnostic ignored &quot;-Wunused-parameter&quot;</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#pragma GCC diagnostic ignored &quot;-Wunused-variable&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#include &lt;ISceneNode.h&gt;</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;IFileSystem.h&gt;</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include &lt;ISceneNodeFactory.h&gt;</span>
<a name="l00015"></a>00015 <span class="preprocessor">#include &lt;ISceneManager.h&gt;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;IVideoDriver.h&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;IXMLWriter.h&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#pragma GCC diagnostic warning &quot;-Wunused-parameter&quot;</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#pragma GCC diagnostic warning &quot;-Wunused-variable&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#ifndef CFIGURE_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define CFIGURE_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="comment">// TODO CGameFieldFigure : public CFigure</span>
<a name="l00026"></a>00026 <span class="comment">// in CGameFieldFigure all field-like methods</span>
<a name="l00027"></a>00027 
<a name="l00033"></a><a class="code" href="class_c_figure.html">00033</a> <span class="keyword">class </span><a class="code" href="class_c_figure.html">CFigure</a> : <span class="keyword">public</span> irr::scene::ISceneNode {
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00049"></a>00049     <a class="code" href="class_c_figure.html#a58047d173634f24a3fc90222c68521d2">CFigure</a>(irr::scene::ISceneNode* parent, irr::scene::ISceneManager* sceneManager, irr::s32 <span class="keywordtype">id</span>,
<a name="l00050"></a>00050             irr::io::IFileSystem* fileSystem, irr::f32 figureSize = 10.0f, irr::io::path figureFile = <span class="stringliteral">&quot;&quot;</span>, irr::scene::ESCENE_NODE_TYPE nodeType = irr::scene::ESNT_CUBE);
<a name="l00051"></a>00051 
<a name="l00075"></a>00075     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a35456f7c9c4a9e51c3354df91a690eb2">createFigureFromFile</a>(irr::io::path pathToFile, irr::scene::ESCENE_NODE_TYPE elementalBlockType = irr::scene::ESNT_CUBE);
<a name="l00076"></a>00076 
<a name="l00083"></a>00083     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a8f8b716ca67f4868ed88745bc0959d9a">saveFigureToFile</a>(irr::io::path pathToFile);
<a name="l00084"></a>00084 
<a name="l00090"></a>00090     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a08e14272f108c53454527a83f4bcd840">isFigureEmpty</a>();
<a name="l00091"></a>00091 
<a name="l00097"></a>00097     <span class="keyword">virtual</span> <a class="code" href="class_c_figure.html#af7f485ea2017fd7ed3b6963e2411fd6e">~CFigure</a>();
<a name="l00098"></a>00098 
<a name="l00102"></a>00102     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#ab15309246081d62f94a15461fcebc3ff">OnRegisterSceneNode</a>();
<a name="l00103"></a>00103 
<a name="l00107"></a>00107     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#adcdf27dd7b4443cfbe71f755962315fb">render</a>();
<a name="l00108"></a>00108 
<a name="l00112"></a>00112     <span class="keyword">virtual</span> <span class="keyword">const</span> irr::core::aabbox3d&lt;irr::f32&gt;&amp; <a class="code" href="class_c_figure.html#a99251bf6decc2d863c4f715ac9f72c6a">getBoundingBox</a>() <span class="keyword">const</span>;
<a name="l00113"></a>00113 
<a name="l00117"></a>00117     <span class="keyword">virtual</span> <span class="keyword">const</span> irr::core::aabbox3d&lt;irr::f32&gt; <a class="code" href="class_c_figure.html#ad40c303b01a1ce95a75cc74393b00e6d">getTransformedBoundingBox</a>() <span class="keyword">const</span>;
<a name="l00118"></a>00118 
<a name="l00122"></a>00122     <span class="keyword">virtual</span> irr::u32 <a class="code" href="class_c_figure.html#a4a33091b086702eaf17c43a080486c2b">getMaterialCount</a>() <span class="keyword">const</span>;
<a name="l00123"></a>00123 
<a name="l00127"></a>00127     <span class="keyword">virtual</span> irr::video::SMaterial&amp; <a class="code" href="class_c_figure.html#ac2637bbd7ebed46f4f25d67818660af7">getMaterial</a>(irr::u32 num);
<a name="l00128"></a>00128 
<a name="l00132"></a>00132     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#ab0f1cb8794db1569b20e09f9dc443dbd">setPosition</a>(<span class="keyword">const</span> irr::core::vector3df&amp; newpos);
<a name="l00133"></a>00133 
<a name="l00137"></a>00137     <span class="keyword">virtual</span> <span class="keyword">const</span> irr::core::vector3df&amp; <a class="code" href="class_c_figure.html#a52bf26bf906b05f2cad89a1da6d0d191">getPosition</a>() <span class="keyword">const</span>;
<a name="l00138"></a>00138 
<a name="l00142"></a>00142     <span class="keyword">virtual</span> <span class="keyword">const</span> irr::core::vector3df&amp; <a class="code" href="class_c_figure.html#aea8f6228c2d7ccf0854ff9d68919ccd1">getRotation</a>() <span class="keyword">const</span>;
<a name="l00143"></a>00143 
<a name="l00147"></a>00147     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#aac378c878c44b112cb37331f7402535e">setRotation</a>(<span class="keyword">const</span> irr::core::vector3df&amp; rotation);
<a name="l00148"></a>00148 
<a name="l00152"></a>00152     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a345d107d126815dd566a0e019edb67d1">setScale</a>(<span class="keyword">const</span> irr::core::vector3df&amp; scale);
<a name="l00153"></a>00153 
<a name="l00157"></a>00157     <span class="keyword">virtual</span> <span class="keyword">const</span> irr::core::vector3df&amp; <a class="code" href="class_c_figure.html#afd53d5c916efd6097bd8567d5f520659">getScale</a>() <span class="keyword">const</span>;
<a name="l00158"></a>00158 
<a name="l00162"></a>00162     <span class="keyword">virtual</span> <span class="keywordtype">void</span> <span class="keyword">remove</span>();
<a name="l00163"></a>00163 
<a name="l00170"></a>00170     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a93841d1c9dda0ad0a414491ad8e5643f">applyTextureToFigure</a>(<span class="keyword">const</span> irr::io::path&amp; textureFileName, irr::video::SColor colour);
<a name="l00171"></a>00171 
<a name="l00177"></a>00177     irr::f32 <a class="code" href="class_c_figure.html#a21cf29ca321109be4276476443e79be4">getFigureSize</a>() <span class="keyword">const</span>;
<a name="l00178"></a>00178 
<a name="l00184"></a>00184     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a7840e399feb2007c86e6634908c70b41">setFigureSize</a>(irr::f32 newSize);
<a name="l00185"></a>00185 
<a name="l00191"></a>00191     irr::core::vector3di <a class="code" href="class_c_figure.html#aa7aef045a3820a2a13a7556b3745a45e">getParentNodeFieldPosition</a>() <span class="keyword">const</span>;
<a name="l00192"></a>00192 
<a name="l00209"></a>00209     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a12ecd248cae015084b7fed967e4bdeca">constructNodesFieldPositions</a>(irr::core::vector3di <a class="code" href="class_c_figure.html#a9a39fd4b3513dbc4b52e044b985a4eab">parentNodeFieldPosition</a>);
<a name="l00210"></a>00210     
<a name="l00232"></a>00232     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#acdfd111126e997b10b41a403b9e41b87">getExtremePositions</a>(irr::core::vector3di direction, irr::core::array&lt;irr::core::vector3di&gt;&amp; extremePositions);
<a name="l00233"></a>00233 
<a name="l00239"></a>00239     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a75c67cdc2b5539f06f191fcabcab6e8f">setParentNodeFieldPosition</a>(irr::core::vector3di newposition);
<a name="l00240"></a>00240 
<a name="l00246"></a>00246     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a0c669a08f0be8ce5eb329af952565a93">affectFieldPositions</a>(irr::core::vector3di affectVector);
<a name="l00247"></a>00247 
<a name="l00251"></a>00251     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a1cb65b826c4d874f07442d62b5d575f6">removeAllCreatedTextures</a>();
<a name="l00252"></a>00252     
<a name="l00258"></a>00258     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a1cb65b826c4d874f07442d62b5d575f6">removeAllCreatedTextures</a>(irr::scene::ISceneNode* node);
<a name="l00259"></a>00259 
<a name="l00260"></a>00260 
<a name="l00266"></a>00266     EGF_FIGURE_TYPE <a class="code" href="class_c_figure.html#a0530b792913bc40fbf8348e55baa5d5e">getFieldFigureType</a>() <span class="keyword">const</span>;
<a name="l00267"></a>00267     
<a name="l00273"></a>00273     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a3b816d1bd875ac8ea4b0fc3ff304c138">isSolid</a>();
<a name="l00274"></a>00274 
<a name="l00280"></a>00280     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a25ae8b28514fda0cd0085c3cc1d3a995">removeNodeByOffset</a>(irr::core::vector3di&amp; offset);
<a name="l00281"></a>00281 
<a name="l00287"></a>00287     irr::core::array&lt;irr::core::vector3di&gt; <a class="code" href="class_c_figure.html#a32bc032b7768e5fd58c9fbd6e55cef76">getFieldPositions</a>() <span class="keyword">const</span>;
<a name="l00288"></a>00288     
<a name="l00294"></a>00294     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#ae1890603d1689bde36a309febcce4a38">setFieldPositions</a>(irr::core::array&lt;irr::core::vector3di&gt; newFieldPositions);
<a name="l00295"></a>00295 
<a name="l00302"></a>00302     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#ab9abcbfa1e06d1334c27cbf6f060426e">getFieldPositionChanged</a>() <span class="keyword">const</span>;
<a name="l00303"></a>00303     
<a name="l00310"></a>00310     <span class="keywordtype">void</span> <a class="code" href="class_c_figure.html#a5464534917482746e41c05d06b5b248f">setFieldPositionChanged</a>(<span class="keywordtype">bool</span> newValue);
<a name="l00311"></a>00311 
<a name="l00317"></a>00317     irr::core::stringw <a class="code" href="class_c_figure.html#a86058c9b1f7978f807378f171af07af8">getFigureName</a>() <span class="keyword">const</span>;
<a name="l00318"></a>00318 
<a name="l00319"></a>00319     <span class="comment">// TODO make private    </span>
<a name="l00323"></a><a class="code" href="class_c_figure.html#aea3b335a168f850759680c4a99ee05a9">00323</a> <span class="comment"></span>    irr::core::array&lt;irr::core::vector3di&gt; <a class="code" href="class_c_figure.html#aea3b335a168f850759680c4a99ee05a9">fieldPositions</a>;
<a name="l00324"></a>00324     
<a name="l00328"></a><a class="code" href="class_c_figure.html#a9a39fd4b3513dbc4b52e044b985a4eab">00328</a>     irr::core::vector3di <a class="code" href="class_c_figure.html#a9a39fd4b3513dbc4b52e044b985a4eab">parentNodeFieldPosition</a>;                
<a name="l00329"></a>00329 
<a name="l00349"></a>00349     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a49fdb26a72a874fa603d9d3753294552">isFigureCollapse</a>();
<a name="l00350"></a>00350 <span class="keyword">private</span>:
<a name="l00357"></a>00357     irr::scene::ISceneNode* getNodeByOffset(irr::core::vector3di offset);
<a name="l00358"></a>00358     
<a name="l00366"></a>00366     <span class="keywordtype">void</span> setElementalBlockColour(irr::scene::ISceneNode* node, irr::video::SColor colour, irr::u32 borderSize = 5);
<a name="l00367"></a>00367         
<a name="l00375"></a>00375     <span class="keywordtype">void</span> removeNodeFromFigure(irr::scene::ISceneNode* nodeToDelete, <span class="keywordtype">bool</span> withIntegrityCheck = <span class="keyword">false</span>);
<a name="l00376"></a>00376     
<a name="l00384"></a>00384     <span class="keywordtype">void</span> setTextureToNodeChildren(irr::scene::ISceneNode* node, irr::video::ITexture* texture, irr::video::SColor colour);
<a name="l00385"></a>00385     
<a name="l00389"></a>00389     <span class="keywordtype">void</span> recalculateBoundingBox();
<a name="l00390"></a>00390     
<a name="l00397"></a>00397     <span class="keywordtype">void</span> calculateChildrenBoundingBox(irr::scene::ISceneNode* node, irr::core::aabbox3df&amp; aabb);
<a name="l00398"></a>00398     
<a name="l00405"></a>00405     <span class="keywordtype">void</span> saveNodeChildrenToFile(irr::io::IXMLWriter* writer, irr::scene::ISceneNode* node);
<a name="l00406"></a>00406     
<a name="l00413"></a>00413     <span class="keywordtype">bool</span> <a class="code" href="class_c_figure.html#a3b816d1bd875ac8ea4b0fc3ff304c138">isSolid</a>(irr::scene::ISceneNode* node);
<a name="l00414"></a>00414 
<a name="l00421"></a>00421     <span class="keywordtype">void</span> construct(irr::scene::ISceneNode* node, irr::core::vector3di nodeFieldPosition);
<a name="l00422"></a>00422 
<a name="l00430"></a>00430     irr::scene::ISceneNode* getNodeByOffset(irr::scene::ISceneNode* node, irr::core::vector3di offset);
<a name="l00431"></a>00431 
<a name="l00438"></a>00438     <span class="keywordtype">void</span> collapseNodes(irr::scene::ISceneNode* node, irr::core::vector3di vector);
<a name="l00439"></a>00439 
<a name="l00440"></a>00440 <span class="keyword">private</span>:
<a name="l00445"></a>00445     irr::core::vector3df figureSize;
<a name="l00446"></a>00446     
<a name="l00450"></a>00450     irr::scene::ESCENE_NODE_TYPE nodeType;
<a name="l00451"></a>00451     
<a name="l00455"></a>00455     irr::core::stringw figureName;
<a name="l00456"></a>00456     
<a name="l00460"></a>00460     irr::core::stringw comment;
<a name="l00461"></a>00461 
<a name="l00465"></a>00465     irr::core::vector3df boxOffset;
<a name="l00466"></a>00466     
<a name="l00470"></a>00470     irr::core::aabbox3df Box;
<a name="l00471"></a>00471     
<a name="l00475"></a>00475     irr::video::SMaterial Material;
<a name="l00476"></a>00476     
<a name="l00480"></a>00480     irr::io::IFileSystem* fileSystem;
<a name="l00481"></a>00481     
<a name="l00485"></a>00485     irr::scene::ISceneNodeFactory* sceneNodeFactory;
<a name="l00486"></a>00486 
<a name="l00490"></a>00490     irr::video::IVideoDriver* videoDriver;
<a name="l00491"></a>00491     
<a name="l00495"></a>00495     <span class="keywordtype">bool</span> fieldPositionChanged;
<a name="l00496"></a>00496     
<a name="l00500"></a>00500     irr::scene::ISceneNode* figureParentNode;
<a name="l00501"></a>00501     
<a name="l00506"></a>00506     irr::scene::ISceneNode* collapsableNode;
<a name="l00507"></a>00507 };
<a name="l00508"></a>00508 
<a name="l00509"></a>00509 <span class="preprocessor">#endif  </span><span class="comment">/* CFIGURE_H */</span>
<a name="l00510"></a>00510 
</pre></div></div><!-- contents -->
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>CFigure.h</b>      </li>

    <li class="footer">Generated on Sun Jul 6 2014 19:35:11 for Tetris Game by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
